$(function() {
	$(".second").html("<a href='category/second.htm?tcId="+tcId+"'>二级分类管理</a>");
	showMajor();
	
	
	/**-----------jquery动效插件--------------*/
	jQuery.fn.shake = function(intShakes, intDistance , intDuration ) {
	    this.each(function() {
	        var jqNode = $(this);
	        jqNode.css({position: 'relative'});
	        for (var x=1; x<=intShakes; x++) {
	            jqNode.animate({ left: (intDistance * -1) },(((intDuration / intShakes) / 4)))
	            .animate({ left: intDistance },((intDuration/intShakes)/2))
	            .animate({ left: 0 },(((intDuration/intShakes)/4)));
	        }
	    });
	    return this;
	}
	$(".del_content").click(function(){
		$('.box-list .box img').unbind();
		var $item=$(".box-list .box");
		if($item.length>0){
			var i=0;
			var s=setInterval(function(){
				var obj=$item[i];
				$(obj).find("img").show().focus().click(function(){
					delCollege(this);
				});
				$(obj).shake(3,3,350);
				if(i==($item.length-1)) clearInterval(s); i++;
			});
		}
		$("div:not(.box)").click(function(){
			$(".box-list .box").find("img").hide();
		})
		
	});
	
	/**------------点击进入到详情分类界面------------*/
	function showMajor(){
		$(".box-list .box .panel .panel-body i").bind("click",function(){
			$dcTypeId=$(this).next().attr("cid");
			window.location.href="category/detail.htm?scId="+scId+"&tcId="+tcId+"&dcTypeId="+$dcTypeId;
		});
	}
});